/*
 * File:   MultiLevelScheduler.h
 * Author: nahumba
 *
 * Created on June 29, 2009, 10:36 PM
 */

#ifndef _MULTILEVELSCHEDULER_H
#define	_MULTILEVELSCHEDULER_H
#include "OSScheduler.h"
class Network;
class MultiLevelScheduler :public OSScheduler{
public:
    MultiLevelScheduler(Network* network, unsigned int q);
    virtual ~MultiLevelScheduler();
    virtual void doScheduling(bool deliveredMsg);

private:
    unsigned int q;
    int currRunningNodeId;
    unsigned int lastLevel;
    bool doContextSwitch();
    queue<int>* priorityQueue[4];
    queue<int> workingQueue;
    int decideQueueLevel(int nodeId);
    int getNextQueue();
    virtual void childReset();
};

#endif	/* _MULTILEVELSCHEDULER_H */

